<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta name="keywords" content="">
	<meta name="author" content="">
	<title>CSS-Switch-iOS</title>

	<!-- Link *** CSS  -->
	<link href="" rel="stylesheet">

	<!-- Script *** JS -->
	<script src="jquery.min.js"></script>
</head>
<body>
<h1>Tools: HTML to joined-String</h1>
<fieldset>
	<legend>Input(HTML):</legend>
	<textarea id="input-content" style="width: 100%; height: 200px;"></textarea>
</fieldset>

<button onclick="convertCode()">convert</button>
<fieldset>
	<legend>Output(Joined-String):</legend>
		<textarea id="ouput-content" style="width: 100%; height: 200px;">
			</textarea>
</fieldset>

<script>
	function convertCode()
	{
		var sourceHtml = $('#input-content').val();
		var resultString = sourceHtml.replace(/(^\s*)/g, "'")
				.replace(/(\s*$)/g, "'")
				.replace(/(\s*)(\n+)\s*/g, "'+\n'")
				.replace("''", "'");
		if (sourceHtml == '')
		{
			resultString = '';
		}
		console.log(resultString);
		$('#ouput-content').val(resultString);
	}
</script>
</body>
</html>